package org.jflame.devAide.plugin;

import java.net.URL;

public class PluginInfo implements Comparable<PluginInfo> {

    private String name;
    private int order;
    private int type;
    private String desc;
    private String icon;
    private URL fxml;
    private boolean fav;// 是否喜好

    public PluginInfo() {
    }

    public PluginInfo(String name, URL fxml) {
        this.name = name;
        this.fxml = fxml;
    }

    public PluginInfo(String name, URL fxml, int order) {
        this.name = name;
        this.order = order;
        this.fxml = fxml;
    }

    public PluginInfo(String name, URL fxml, String icon, int order) {
        this.name = name;
        this.order = order;
        this.fxml = fxml;
        this.icon = icon;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public URL getFxml() {
        return fxml;
    }

    public void setFxml(URL fxml) {
        this.fxml = fxml;
    }

    public boolean isFav() {
        return fav;
    }

    public void setFav(boolean fav) {
        this.fav = fav;
    }

    @Override
    public int compareTo(PluginInfo o) {
        if (this.getOrder() > o.getOrder())
            return 1;
        else if (this.getOrder() < o.getOrder())
            return -1;
        else
            return this.getName()
                    .compareTo(o.getName());
    }

}
